/*
Rilego - An easy Images 2 E-Book converter.
Copyright (C) 2011  Federico Improta (Kirys)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/

package it.kirys.rilego.engine.project;

import it.kirys.rilego.engine.loaders.imagesources.IImageSource;
import it.kirys.rilego.engine.loaders.imagesources.SourcesSorter;
import it.kirys.rilego.engine.outputbuilders.IOutputBuilder;
import it.kirys.rilego.engine.processors.IProcessorsFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 *
 * @author Federico Improta
 */
public class Project {
	String title;
	String author;

	List<IImageSource> sources;
	private IProcessorsFactory factory;
	private IOutputBuilder builder;


	/**
	 * get the current assigned builder
	 * @return
	 */
	public IOutputBuilder getBuilder() {
		return builder;
	}

	/**
	 * assign a builder to the project
	 * @param builder
	 */
	public void setBuilder(IOutputBuilder builder) {
		this.builder = builder;
	}

	/**
	 * Get the author of the source input
	 * @return
	 */
	public String getAuthor() {
		return author;
	}

	/**
	 * Set the author of the source input
	 * @param author
	 */
	public void setAuthor(String author) {
		this.author = author;
	}

	/**
	 * Get the title of the source input
	 * @return
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * Set the title of the source input
	 * @param title
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * Set the processor factory for the project
	 * @param factory
	 */
	public void setFactory(IProcessorsFactory factory) {
		this.factory = factory;
	}

	/**
	 * get current processor factory
	 * @return
	 */
	public IProcessorsFactory getFactory() {
		return factory;
	}

	/**
	 * Get project source images
	 * @return
	 */
	public List<IImageSource> getSources() {
		return sources;
	}

	/**
	 * Sort all images into the project
	 */
	public void sortSources(){
		Collections.sort(sources,new SourcesSorter());
	}
	
	public Project() {
		sources = new ArrayList<IImageSource>();
		title="";
		author="";
	}


}
